package org.yogurtcat.server.modules.rabbitmq.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.yogurtcat.server.modules.rabbitmq.domain.RabbitMQConfig;
import org.yogurtcat.server.modules.rabbitmq.dao.RabbitMQConfigRepository;

@Service
public class RabbitMQConfigServiceImpl implements RabbitMQConfigService {
	
	@Autowired
	private RabbitMQConfigRepository rabbitMQConfigRepository;


	@Override
	public RabbitMQConfig save(RabbitMQConfig data) {
		return rabbitMQConfigRepository.save(data);
	}

	@Override
	public RabbitMQConfig find() {
		return rabbitMQConfigRepository.findTopByOrderById();
	}

	@Override
	public void delete(RabbitMQConfig rabbitMQConfig) {
		rabbitMQConfigRepository.delete(rabbitMQConfig);
	}
}
